

#include <string>
#include <iostream>

#include "bocat/common/url.hpp"

using namespace bocat::common;


int main()
{
	const char*	plains[] = { 
			"http://www.abc.com/index.php", 
			"http://www.abc.com/index.php?n=search", 
			"http://www.abc.com/index.php#top", 
			"http://www.abc.com/", 
			"http://www.abc.com", 
			"http://www.abc.com:8080/index.php", 
			"http://who@www.abc.com/index.php",
			"http://who:what@www.abc.com/index.php",
			NULL
		};

	for (int i=0; ; i++) {
		const char*	p = plains[ i ];
		if (NULL == p) break;

		std::cout << " - handling " << p << std::endl;

		URL	url( p );

		std::cout << "     URL : " << url << std::endl
			      << "  schema : " << url.getSchema() << std::endl
				  << "    host : " << url.getHostName() << std::endl
				  << "    port : " << url.getPort() << std::endl
				  << "    path : " << url.getPath() << std::endl
				  << "reversed : " << url.getReversedURL() << std::endl
				  << std::endl;
	}

      return 0;
}


